<?php

namespace App\Http\Controllers\BaseData;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class SystemController extends Controller
{
    //
    public function index()
    {
        if (post("?")) {
            // return (Role::search(post("search"))->getGrid());
        } else {
            $param = F();
            $param['sysinfo'] = [
                'laravel' => app()::VERSION, // laravel 版本
                'os' => $_SERVER["SERVER_SOFTWARE"], //服务器标识
                'version' => PHP_VERSION, //PHP版本
                'time' => date("Y-m-d H:i:s", time()), //服务器时间
                'pc' => $_SERVER['SERVER_NAME'], //主机名
                'osname' => php_uname(), //系统版本号
                'language' => $_SERVER['HTTP_ACCEPT_LANGUAGE'], //服务器语言
                'port' => $_SERVER['SERVER_PORT'], //端口
                'max_upload' => ini_get("file_uploads") ? ini_get("upload_max_filesize") : "Disabled", //最大上传
                'max_ex_time' => ini_get("max_execution_time") . "秒", //脚本最大执行时间
                'mysql_version' => DB::select("select version() as mysqlv")[0]->mysqlv, //mysql 版本
            ];
            return view('BaseData.SystemController.index', $param);
        }
    }
}
